//
//  FocusDoctorCell.m
//  QuickCure1
//
//  Created by Haozhong Chen on 2016/10/31.
//  Copyright © 2016年 maoge. All rights reserved.
//

#import "FocusDoctorCell.h"
#import "FocusDoctorData.h"
#import <UIImageView+WebCache.h>

/*
 @property(nonatomic,copy)NSString*doctor_gender;
 @property(nonatomic,copy)NSString*doctor_id;
 @property(nonatomic,copy)NSString*hospital_name;
 @property(nonatomic,copy)NSString*doctor_portrait;
 @property(nonatomic,copy)NSString*flower;
 @property(nonatomic,copy)NSString*doctor_title_id;
 @property(nonatomic,copy)NSString*doctor_title_name;
 @property(nonatomic,copy)NSString*banner;
 @property(nonatomic,copy)NSString*doctor_name;
 @property(nonatomic,copy)NSString*doctor_attention_id;
 @property(nonatomic,copy)NSString*hospital_id;
 @property(nonatomic,copy)NSString*operation_count;
 */

@interface FocusDoctorCell ()
@property (weak, nonatomic) IBOutlet UIImageView *doctor_portrait;
@property (weak, nonatomic) IBOutlet UILabel *doctor_title_name;
@property (weak, nonatomic) IBOutlet UILabel *doctor_name;
@property (weak, nonatomic) IBOutlet UILabel *hospital_name;
@property (weak, nonatomic) IBOutlet UIButton *flower;
@property (weak, nonatomic) IBOutlet UIButton *operation_count;
@property (weak, nonatomic) IBOutlet UIButton *banner;

@end


@implementation FocusDoctorCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(void)setDataModel:(FocusDoctorData *)dataModel
{
    _dataModel=dataModel;

    
    [self.doctor_portrait sd_setImageWithURL:[NSURL URLWithString:dataModel.doctor_portrait] placeholderImage:[UIImage imageNamed:@"illness_img_person.png"] options:SDWebImageRetryFailed];
    _doctor_name.text=dataModel.doctor_name;
    _doctor_title_name.text=dataModel.doctor_title_name;

    _hospital_name.text=dataModel.doctor_hospital_name;

    [self.flower setTitle:[self appendStringWithString:dataModel.flower] forState:UIControlStateNormal];
    [self.flower setTitleColor:kThemeColor forState:UIControlStateNormal];
    [self.flower sizeToFit];
   
 
    [self.banner setTitle:[self appendStringWithString:dataModel.banner] forState:UIControlStateNormal];
    [self.banner setTitleColor:kThemeColor forState:UIControlStateNormal];

    [self.operation_count setTitle:[self appendStringWithString:dataModel.operation_count] forState:UIControlStateNormal];
    [self.operation_count setTitleColor:kThemeColor forState:UIControlStateNormal];
   
}

-(NSString*)appendStringWithString:(NSString*)string
{
    NSString*str=[[NSString alloc]initWithFormat:@"%@        ",string];
//    NSLog(@"%@",str);
    return str;
}

@end
